//
//  FriendCollectionViewCell.m
//  YiXiProject
//
//  Created by iMac on 2019/7/25.
//  Copyright © 2019 iMac. All rights reserved.
//

#import "FriendCollectionViewCell.h"

@implementation FriendCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    if(self = [super initWithFrame:frame])
    {
        _headImg = [[UIImageView alloc]init];
        _headImg.layer.cornerRadius = (SCREEN_WIDTH/4-10)/2;
        _headImg.image = [UIImage imageNamed:@"head"];
        _headImg.layer.masksToBounds = YES;
        [self.contentView addSubview:_headImg];
        _headImg.sd_layout.leftSpaceToView(self.contentView, 5).topSpaceToView(self.contentView, 5).rightSpaceToView(self.contentView, 5).heightIs(self.contentView.bounds.size.width-10);
        
        
        _textLabel = [[UILabel alloc]init];
        _textLabel.numberOfLines = 0;
        _textLabel.text = @"hello !";
        _textLabel.textAlignment = NSTextAlignmentCenter;
        _textLabel.font = HeiTiFont(17);
        _textLabel.textColor = Color(0.3, 0.3, 0.3, 1);
        [self.contentView addSubview:_textLabel];
        _textLabel.sd_layout.leftSpaceToView(self.contentView, 5).topSpaceToView(_headImg, 0).rightSpaceToView(self.contentView, 5).bottomSpaceToView(self.contentView, 0);
    }
    return self;
}

-(void)installDataDic:(NSDictionary *)dic
{
    [_headImg sd_setImageWithURL:[NSURL URLWithString:dic[@"photo"]] placeholderImage:nil];
    _textLabel.text = dic[@"name"];
    
//    _headImg.image = [UIImage imageNamed:@"head"];
//    _textLabel.text = @"hello";
}


@end
